<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./template.xhtml">

            <ui:define name="content">
                <!-- NEW SPOT ################################################################# -->  
                <h:form >                           
                    <p:panel header="Pick a Restaurant" id="selectedRest">

                        <h:messages errorClass="error"/> 
                        <h:selectOneListbox id="restList" style="height:100px"  value="#{newBean.restId}">
                            <f:selectItem itemValue="0" itemLabel="Select a Restaurant" />
                            <f:selectItems value="#{newBean.restList}" var="rest" itemLabel="#{rest.name}" itemValue="#{rest.rid}" />
                        </h:selectOneListbox>
                        <p:commandButton value="Set" actionListener="#{newBean.findRestaurants()}" update="restList"/>
                        <p:commandButton value="Submit" update="panel" />
                    </p:panel>
                    <p:panel id="panel" >
                        <h:outputText value="#{newBean.restId}" />
                    </p:panel>

                                
                </h:form> 
            </ui:define>

        </ui:composition>

    </body>
</html>
